package com.situ.shoplook.dubbo.dao;

import com.situ.shoplook.common.model.Category;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 功能：
 *
 * @author 千堆雪
 * @version 1.0.0
 * <p>
 * created by 千堆雪 on 2024/8/24, last modified by 千堆雪 on 2024/8/24
 */
@Mapper
public interface CategoryDao {
    List<Category> findAll();

    int save(Category category);

    int update(Category category);

    int deleteByIds(Integer[] ids);

    default boolean deleteById(Integer id) {
        return deleteByIds(new Integer[]{id}) > 0;
    }

    default boolean delete(Category category) {
        return deleteById(category.getId());
    }
}
